﻿using System.Reflection;
using System;
namespace CharpClassGen
{
    public class Field : Member
    {
        private bool autoNew = false;
        public Field AutoNew(bool autoNew)
        {
            this.autoNew = autoNew;
            return this;
        }
        public Field(string type, string name,  Accesser accesser = Accesser.Private, ExtendModifier extendModifier = ExtendModifier.none) : base(accesser, extendModifier, type, name)
        {
        }
        public override string ToString()
        {
            base.ToString();
            if (type == "string")
            {
                sb.Append("= \"\"");
            }else if (autoNew)
            {
                sb.Append($"=new {type}()");
            }
            sb.Append(";");
            return sb.ToString();
        }
    }
}



